<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class ModifyOffers extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('offers', function (Blueprint $table) {
            $table->integer('member_id')->unsigned()->comment('会员 ID')->change();
            $table->string('title')->comment('供应商产品标题')->change(); // 供应产品标题
            $table->integer('primary_category_id')->unsigned()->comment('主分类（大分类）编号，虽然没什么卵用')->change(); // 主分类 ID
            $table->integer('secondary_category_id')->unsigned()->comment('实际的分类 ID，其 parent_id 就是大分类 ID')->change(); // 次分类 ID
            $table->decimal('price', 10, 2)->comment('价格（元）')->change(); // 价格
            $table->string('unit')->comment('单位')->change(); // 单位
            $table->integer('amount')->comment('数量')->unsigned()->change(); // 数量
            $table->integer('minimum_order')->unsigned()->comment('最小起订量')->change(); // 最小起订量

            $table->integer('province_id')->unsigned()->comment('省份 ID');
            $table->integer('city_id')->unsigned()->comment('市区 ID');
            $table->integer('country_id')->unsigned()->comment('乡镇 ID');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        //
    }
}
